//
// clientmanager.h
//

#ifndef CLIENT_MANAGER_H
#define CLIENT_MANAGER_H

#include <iostream>
#include <sstream>
#include <string>
#include <map>

#include "network.h"

using namespace std;

class Client {
private:
	int id;
	string name;
	NetworkPeer peer;
	
public:
	Client();
	Client(int id, const string name, NetworkPeer peer);
	
	void process(void *data);
	void disconnect();
	
};

class ClientManager {
private:
	map<NetworkPeer, Client*> clients;
	int nextClient; // the id of the next client
	
public:
	ClientManager();
	bool add(NetworkPeer p);
	bool drop(NetworkPeer p);
	void process(NetworkPeer p, void* data);
};

#endif
